


def countPrimes(n):
    primes = []
    if n == 0 or n == 1 or n == 2:
        print(0)
    for i in range(n + 1):
        primes.append(True)
    for i in range(2, n + 1):
        if primes[i] == True:
            p = i
            j = 2
            while p * j <= n:
                primes[p * j] = False
                j += 1
    primes = primes[2: len(primes) - 1]
    ans = primes.count(True)
    return ans

n = int(input())
print(countPrimes(n))

